function timer(value, time = 1000) {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve(value)
    }, time)
  })
}

var a = 'hello '
var now = Date.now()
timer(a)
  .then((a) => {
    var b = 'lagou '
    return timer(a + b)
  })
  .then((ab) => {
    var c = 'I & U'
    return timer(ab + c)
  })
  .then((abc) => {
    console.log(abc)
    console.log(Date.now() - now)
  })

  
setTimeout(() => {
  var a = 'hello '
  setTimeout(() => {
    var b = 'lagou '
    setTimeout(() => {
      var c = 'I & U'
      console.log(a + b + c)
      console.log(Date.now() - now)
    }, 1000)
  }, 1000)
}, 1000)
